#ifndef _WINDOW_H_
#define _WINDOW_H_
#include <Windows.h>
#include <string>

#include "slcore/Renderer.h"
#include "slcore/View.h"

class SLWindow : public sl::View
{
public:

	enum CURSOR_STATE
	{
		NORMAL,
		DOWN,
		WAIT,
		DISABLE,
		TEXT,
		HIDE
	};

	SLWindow(void);
	virtual ~SLWindow(void);

	static LRESULT CALLBACK WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );

	bool Initialize( const char * strName, const char * strClass, short sMenuID, short sIconID,
		HCURSOR hCursor , RECT & rect, unsigned long ulStyle = WS_POPUP );

	void ShowBaseWindow();

	void MoveCenterWindow();

	void DestroyBaseWindow();

	void UpdateBaseWindow();

	void SetFocusBaseWindow();

	void LoadWindowCursor();

	void SetWindowCursor( CURSOR_STATE cursor );

	virtual int PeekMessagePumping();
private:

	bool InitApplication( short sMenuID, short sIconID, HCURSOR hCursor );

	bool InitInstance( unsigned long ulStyle, RECT & rect );

	bool InitRenderer();

	void ReleaseDevice();

	void MainProcess();

	HWND			m_hWnd;
	std::string		m_strWindowName;
	std::string		m_strWindowClass;

	sl::RendererPtr	m_Renderer;
	sl::ViewPtr		m_View;
	HCURSOR			m_hCursor[8];

};


#endif

